package com.qidian.mes.pojo;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.alibaba.excel.annotation.write.style.ContentRowHeight;
import com.alibaba.excel.annotation.write.style.HeadRowHeight;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.qidian.mes.desensitivity.DesensitivityAnnotation;
import com.qidian.mes.excel.UserGenderConverter;

import java.util.Date;

/**
 * @Author 小可怎么都睡不够
 * @Company 起点编程
 * @Description
 * @Time 2024/4/3 15:55
 */
@HeadRowHeight(25) // 表头行高
@ContentRowHeight(20) // 内容行高
@ColumnWidth(20) // 列宽
public class User {
    @ExcelProperty(value = {"基本信息","用户编号"}, index = 0)
    private Long userId; // 用户编号
    @ExcelProperty(value = {"基本信息","用户名"}, index = 1)
    private String username; // 用户登录名
    // 密码不导出，这里要忽略
    @ExcelIgnore // 忽略这个属性
    private String loginPass; // 登陆密码
    @ExcelProperty(value = {"基本信息","用户昵称"}, index = 2)
    @DesensitivityAnnotation
    private String nickname; // 用户昵称
    @ExcelProperty(value = "用户手机号码", index = 3)
    @DesensitivityAnnotation(value = "*",length = 4,prefixNoMaskLength = 3,suffixNoMaskLength = 4)
    private String userTel; // 用户手机号码
    @ExcelProperty(value = "用户邮箱", index = 4)
    private String userEmail; // 用户邮箱
    @ExcelProperty(value = "用户性别", index = 5, converter = UserGenderConverter.class)
    private Integer userGender; // 用户性别 1 男 2 女 3 未知
    @ExcelProperty(value = "用户备注", index = 6)
    private String userNotes; // 备注
    @ExcelProperty(value = "用户状态", index = 7)
    private Integer userStatus; // 用户状态 1 正常 2禁用 99 删除
    @ExcelProperty(value = "创建时间", index = 8)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime; // 创建时间
    @ExcelProperty(value = "修改时间", index = 9)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date modifyTime; // 最后修改时间
    @ExcelIgnore
    private String userHead; // 用户头像
    @ExcelIgnore
    private Long deptId; // 部门编号
    @ExcelIgnore
    private Dept dept;

    public String getUserHead() {
        return userHead;
    }

    public void setUserHead(String userHead) {
        this.userHead = userHead;
    }

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getLoginPass() {
        return loginPass;
    }

    public void setLoginPass(String loginPass) {
        this.loginPass = loginPass;
    }

    public String getNickname() {
        return nickname;
    }

    public void setNickname(String nickname) {
        this.nickname = nickname;
    }

    public String getUserTel() {
        return userTel;
    }

    public void setUserTel(String userTel) {
        this.userTel = userTel;
    }

    public String getUserEmail() {
        return userEmail;
    }

    public void setUserEmail(String userEmail) {
        this.userEmail = userEmail;
    }

    public Integer getUserGender() {
        return userGender;
    }

    public void setUserGender(Integer userGender) {
        this.userGender = userGender;
    }

    public String getUserNotes() {
        return userNotes;
    }

    public void setUserNotes(String userNotes) {
        this.userNotes = userNotes;
    }

    public Integer getUserStatus() {
        return userStatus;
    }

    public void setUserStatus(Integer userStatus) {
        this.userStatus = userStatus;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getModifyTime() {
        return modifyTime;
    }

    public void setModifyTime(Date modifyTime) {
        this.modifyTime = modifyTime;
    }

    public Long getDeptId() {
        return deptId;
    }

    public void setDeptId(Long deptId) {
        this.deptId = deptId;
    }

    public Dept getDept() {
        return dept;
    }

    public void setDept(Dept dept) {
        this.dept = dept;
    }
}
